!ifndef BIN
BIN = $(ROOT)\bin
!endif
!ifndef BUILD
BUILD = .
!endif
!ifndef LIBRARY
LIBRARY = $(ROOT)\lib
!endif
!ifndef INCLUDE
INCLUDE = -I$(ROOT)\include
!else
INCLUDE = $(INCLUDE) -I$(ROOT)\include
!endif
!ifndef UPDATE_VERSION
UPDATE_VERSION = $(BIN)\update_version.exe
!endif

LIB = $(LIB);$(LIBRARY)

# set NODEBUG _before_ win32.mak
!ifndef DEBUG
NODEBUG=yes 
!endif

!include <win32.mak>

# any modifications to the flags should go _after_ win32.mak
!ifdef UNICODE
cflags = $(cflags) -DUNICODE -D_UNICODE
!endif

cflags = $(cflags) -D_CRT_NON_CONFORMING_SWPRINTFS -D_CRT_SECURE_NO_DEPRECATE 

all: $(TARGET) 

clean: _make-clean_
  del $(TARGET) $(OBJ)

debug:
  $(MAKE) DEBUG=YES UNICODE=YES

unicode:
  $(MAKE) UNICODE=YES

release:
  $(MAKE) 

.cpp.obj:
  $(cc) $(cflags) $(cvarsmt) $(cdebug) /WX $<

.c.obj:
  $(cc) $(cflags) $(cvarsmt) $(cdebug) /WX $<

.rc.res: 
  $(rc) $(rcvars) $(rcflags) /fo $@ $<
